package cn.com.roy.thread.transdata;

import java.util.List;

public class ThreadA extends Thread{
    private TransService service;

    public ThreadA(TransService service){
        this.service = service;
    }

    @Override
    public void run() {
        super.run();
        for (int i = 0; i < 10; i++) {
            service.add();
            System.out.println(Thread.currentThread().getName()+" 添加了"+(i+1) + "个元素");
            try {

                Object o ;
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
